﻿package core.ui.dialogs
{
    import core.enum.*;
    import core.event.*;
    import core.image.*;
    import core.ui.controls.*;

    public class DiffuseDialog extends BitmapOperationDialogBase
    {
        var f:Filter;
        var b:Slidebar;

        public function DiffuseDialog(param1:Tuyitu)
        {
            super(param1, "rm_diffuse", 240, 130, Action.DiffuseFilter);
            this.f = new Filter();
            this.b = new Slidebar("rm_amount", 2, 20, 200, 5);
            this.b.addEventListener(SliderEvent.CHANGE, this.Change, false, 1, true);
            this.b.x = 20;
            this.b.y = 35;
            addChild(this.b);
            return;
        }// end function

        override public function Change(... args) : void
        {
            if (!locked)
            {
                bm.copyPixels(bc, bm.rect, bm.rect.topLeft);
                this.f.Diffuse(bm, bc, this.b.value, selection, offset);
            }
            return;
        }// end function

    }
}
